import Vue from 'vue'
import Router from 'vue-router'



Vue.use(Router);

export default new Router({
  routes: [
    {
      path:"/",
      name:"首页",
      component:require("../page/home.vue"),
      redirect: '/goods',
      children:[
        {
          path:"goods",
          name:"产品管理",
          component:require("../page/goodslist.vue"),
          meta: {routerindex: "1"}
        },{
          path:"addgood",
          name:"添加商品",
          component:require("../page/addgood.vue"),
          meta: {routerindex: "1"}
        },
        {
          path:"goodinfo/:id",
          name:"商品详情",
          component:require("../page/goodinfo.vue"),
          meta: {routerindex: "1"}
        },
        {
          path:"orders",
          name:"订单管理",
          component:require("../page/orderlist.vue"),
          meta: {routerindex: "2"}
        },
        {
          path:"orderinfo/:id",
          name:"订单详情",
          component:require("../page/orderinfo.vue"),
          meta: {routerindex: "2"}
        },
        {
          path:"brandstore",
          name:"品牌信息",
          component:require("../page/brandstore.vue"),
          meta: {routerindex: "4"}
        },
        {
          path:"edibrandstore",
          name:"编辑品牌信息",
          component:require("../page/edibrandstore.vue"),
          meta: {routerindex: "4"}
        },
        {
          path:"franchise_store",
          name:"加盟商管理",
          component:require("../page/franchise_store.vue"),
          meta: {routerindex: "3"}
        },
        {
          path:"publicgoodlist",
          name:"公共区商品",
          component:require("../page/publicgoodlist.vue"),
          meta: {routerindex: "5"}
        },
        {
          path:"publicgoodinfo/:id",
          name:"公共区商品详情",
          component:require("../page/pubilcgoodinfo.vue"),
          meta: {routerindex: "5"}
        }
      ]
    },
    {
      path:"/login",
      name:"登录",
      component:require("../page/login.vue")
    }
  ]
})
